﻿using EFCore.Context;
using IResoitory;
using Microsoft.EntityFrameworkCore;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Resoitory
{
    //仓储层_管理员接口实现类
    public class AdminRepository :BaseRepository<Admin>,IAdminRepository
    {
        private readonly EducationContext _context;

        public AdminRepository(EducationContext context)
        {
            base.context = context;
            _context = context;
        }
        //登录验证
        public override async Task<bool> islogin(string uid,string pwd)
        {
            var result = await _context.Set<Admin>().Where(o=>o.AdminPhone == uid && o.AdminPwd == pwd).FirstOrDefaultAsync();
            if (result != null) 
            {
                return true;
            }
            return false;
        }
    }
}
